home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / INFO / DHRY0217.ZIP / DHRY0217.C next >
Text File  |  1990-05-10  |  26KB  |  734 lines

  1. /*    EVERBODY:    Please read "APOLOGY" below. -rick 01/06/86
  2.  *
  3.  *    "DHRYSTONE" Benchmark Program
  4.  *
  5.  *    Version:    C/1.1, 12/01/84
  6.  *
  7.  *    Date:        PROGRAM updated 01/06/86, RESULTS updated 02/17/86
  8.  *
  9.  *    Author:        Reinhold P. Weicker,  CACM Vol 27, No 10, 10/84 pg. 1013
  10.  *            Translated from ADA by Rick Richardson
  11.  *            Every method to preserve ADA-likeness has been used,
  12.  *            at the expense of C-ness.
  13.  *
  14.  *    Compile:    cc -O dry.c -o drynr            : No registers
  15.  *            cc -O -DREG=register dry.c -o dryr    : Registers
  16.  *
  17.  *    Defines:    Defines are provided for old C compiler's
  18.  *            which don't have enums, and can't assign structures.
  19.  *            The time(2) function is library dependant; Most
  20.  *            return the time in seconds, but beware of some, like
  21.  *            Aztec C, which return other units.
  22.  *            The LOOPS define is initially set for 50000 loops.
  23.  *            If you have a machine with large integers and is
  24.  *            very fast, please change this number to 500000 to
  25.  *            get better accuracy.  Please select the way to
  26.  *            measure the execution time using the TIME define.
  27.  *            For single user machines, time(2) is adequate. For
  28.  *            multi-user machines where you cannot get single-user
  29.  *            access, use the times(2) function.  If you have
  30.  *            neither, use a stopwatch in the dead of night.
  31.  *            Use a "printf" at the point marked "start timer"
  32.  *            to begin your timings. DO NOT use the UNIX "time(1)"
  33.  *            command, as this will measure the total time to
  34.  *            run this program, which will (erroneously) include
  35.  *            the time to malloc(3) storage and to compute the
  36.  *            time it takes to do nothing.
  37.  *
  38.  *    Run:        drynr; dryr
  39.  *
  40.  *    Results:    If you get any new machine/OS results, please send to:
  41.  *
  42.  *                {ihnp4,vax135,..}!houxm!castor!pcrat!rick
  43.  *
  44.  *            and thanks to all that do.  Space prevents listing
  45.  *            the names of those who have provided some of these
  46.  *            results.  I'll be forwarding these results to
  47.  *            Rheinhold Weicker.
  48.  *
  49.  *    Note:        I order the list in increasing performance of the
  50.  *            "with registers" benchmark.  If the compiler doesn't
  51.  *            provide register variables, then the benchmark
  52.  *            is the same for both REG and NOREG.
  53.  *
  54.  *    PLEASE:        Send complete information about the machine type,
  55.  *            clock speed, OS and C manufacturer/version.  If
  56.  *            the machine is modified, tell me what was done.
  57.  *            On UNIX, execute uname -a and cc -V to get this info.
  58.  *
  59.  *    80x8x NOTE:    80x8x benchers: please try to do all memory models
  60.  *            for a particular compiler.
  61.  *
  62.  *    APOLOGY (1/30/86):
  63.  *        Well, I goofed things up!  As pointed out by Haakon Bugge,
  64.  *        the line of code marked "GOOF" below was missing from the
  65.  *        Dhrystone distribution for the last several months.  It
  66.  *        *WAS* in a backup copy I made last winter, so no doubt it
  67.  *        was victimized by sleepy fingers operating vi!
  68.  *
  69.  *        The effect of the line missing is that the reported benchmarks
  70.  *        are 15% too fast (at least on a 80286).  Now, this creates
  71.  *        a dilema - do I throw out ALL the data so far collected
  72.  *        and use only results from this (corrected) version, or
  73.  *        do I just keep collecting data for the old version?
  74.  *
  75.  *        Since the data collected so far *is* valid as long as it
  76.  *        is compared with like data, I have decided to keep
  77.  *        TWO lists- one for the old benchmark, and one for the
  78.  *        new.  This also gives me an opportunity to correct one
  79.  *        other error I made in the instructions for this benchmark.
  80.  *        My experience with C compilers has been mostly with
  81.  *        UNIX 'pcc' derived compilers, where the 'optimizer' simply
  82.  *        fixes sloppy code generation (peephole optimization).
  83.  *        But today, there exist C compiler optimizers that will actually
  84.  *        perform optimization in the Computer Science sense of the word,
  85.  *        by removing, for example, assignments to a variable whose
  86.  *        value is never used.  Dhrystone, unfortunately, provides
  87.  *        lots of opportunities for this sort of optimization.
  88.  *
  89.  *        I request that benchmarkers re-run this new, corrected
  90.  *        version of Dhrystone, turning off or bypassing optimizers
  91.  *        which perform more than peephole optimization.  Please
  92.  *        indicate the version of Dhrystone used when reporting the
  93.  *        results to me.
  94.  *
  95.  * RESULTS BEGIN HERE
  96.  *
  97.  *----------------DHRYSTONE VERSION 1.1 RESULTS BEGIN--------------------------
  98.  *
  99.  * MACHINE    MICROPROCESSOR    OPERATING    COMPILER    DHRYSTONES/SEC.
  100.  * TYPE                SYSTEM                NO REG    REGS
  101.  * --------------------------    ------------    -----------    ---------------
  102.  * IBM PC/AT    80286-7.5Mhz    Venix/286 SVR2  cc              1159    1254 *15
  103.  * Gulfstream XT 80286-8MHz    PCDOS 3.1    Turbo C 2.0     1388    1515
  104.  *
  105.  *
  106.  *----------------DHRYSTONE VERSION 1.0 RESULTS BEGIN--------------------------
  107.  *
  108.  * MACHINE    MICROPROCESSOR    OPERATING    COMPILER    DHRYSTONES/SEC.
  109.  * TYPE                SYSTEM                NO REG    REGS
  110.  * --------------------------    ------------    -----------    ---------------
  111.  * Commodore 64    6510-1MHz    C64 ROM        C Power 2.8      36      36
  112.  * HP-110    8086-5.33Mhz    MSDOS 2.11    Lattice 2.14     284     284
  113.  * IBM PC/XT    8088-4.77Mhz    PC/IX        cc         271     294
  114.  * CCC 3205    ?        Xelos(SVR2)     cc         279     296
  115.  * Perq-II    2901 bitslice    Accent S5c     cc (CMU)     301     301
  116.  * IBM PC/XT    8088-4.77Mhz    COHERENT 2.3.43    MarkWilliams cc  296     317
  117.  * Cosmos    68000-8Mhz    UniSoft        cc         305     322
  118.  * IBM PC/XT    8088-4.77Mhz    Venix/86 2.0    cc         297     324
  119.  * DEC PRO 350  11/23           Venix/PRO SVR2  cc               299     325
  120.  * IBM PC    8088-4.77Mhz    MSDOS 2.0    b16cc 2.0     310     340
  121.  * PDP11/23    11/23           Venix (V7)      cc               320     358
  122.  * Commodore Amiga        ?        Lattice 3.02     368     371
  123.  * PC/XT        8088-4.77Mhz    Venix/86 SYS V  cc               339     377
  124.  * IBM PC    8088-4.77Mhz    MSDOS 2.0    CI-C86 2.20M     390     390
  125.  * IBM PC/XT    8088-4.77Mhz    PCDOS 2.1    Wizard 2.1     367     403
  126.  * IBM PC/XT    8088-4.77Mhz    PCDOS 3.1    Lattice 2.15     403     403 @
  127.  * Colex DM-6    68010-8Mhz    Unisoft SYSV    cc         378     410
  128.  * IBM PC    8088-4.77Mhz    PCDOS 3.1    Datalight 1.10     416     416
  129.  * IBM PC    NEC V20-4.77Mhz    MSDOS 3.1    MS 3.1          387     420
  130.  * IBM PC/XT    8088-4.77Mhz    PCDOS 2.1    Microsoft 3.0     390     427
  131.  * IBM PC    NEC V20-4.77Mhz    MSDOS 3.1    MS 3.1 (186)      393     427
  132.  * PDP-11/34    -        UNIX V7M    cc         387     438
  133.  * IBM PC    8088, 4.77mhz    PC-DOS 2.1    Aztec C v3.2d     423     454
  134.  * Tandy 1000    V20, 4.77mhz    MS-DOS 2.11    Aztec C v3.2d     423     458
  135.  * Tandy TRS-16B 68000-6Mhz    Xenix 1.3.5    cc         438     458
  136.  * PDP-11/34    -        RSTS/E        decus c         438     495
  137.  * Onyx C8002    Z8000-4Mhz    IS/1 1.1 (V7)    cc         476     511
  138.  * CCC 3230            Xelos (SysV.2)    cc         507     565
  139.  * Tandy TRS-16B 68000-6Mhz    Xenix 1.3.5    Green Hills     609     617
  140.  * DEC PRO 380  11/73           Venix/PRO SVR2  cc               577     628
  141.  * FHL QT+    68000-10Mhz    Os9/68000    version 1.3     603     649 FH
  142.  * Apollo DN550    68010-?Mhz    AegisSR9/IX    cc 3.12         666     666
  143.  * HP-110    8086-5.33Mhz    MSDOS 2.11    Aztec-C         641     676 
  144.  * ATT PC6300    8086-8Mhz    MSDOS 2.11    b16cc 2.0     632     684
  145.  * IBM PC/AT    80286-6Mhz    PCDOS 3.0    CI-C86 2.1     666     684
  146.  * Tandy 6000    68000-8Mhz    Xenix 3.0    cc         694     694
  147.  * IBM PC/AT    80286-6Mhz    Xenix 3.0    cc         684     704 MM
  148.  * Macintosh    68000-7.8Mhz 2M    Mac Rom        Mac C 32 bit int 694     704
  149.  * Macintosh    68000-7.7Mhz    -        MegaMax C 2.0     661     709
  150.  * IBM PC/AT    80286-6Mhz    Xenix 3.0    cc         704     714 LM
  151.  * Codata 3300    68000-8Mhz    UniPlus+ (v7)    cc         678     725
  152.  * WICAT MB    68000-8Mhz    System V    WICAT C 4.1     585     731 ~
  153.  * Cadmus 9000    68010-10Mhz    UNIX        cc         714     735
  154.  * AT&T 6300    8086-8Mhz       Venix/86 SVR2   cc               668     743
  155.  * Cadmus 9790    68010-10Mhz 1MB    SVR0,Cadmus3.7    cc         720     747
  156.  * NEC PC9801F    8086-8Mhz    PCDOS 2.11    Lattice 2.15     768      -  @
  157.  * ATT PC6300    8086-8Mhz    MSDOS 2.11    CI-C86 2.20M     769     769
  158.  * Burroughs XE550 68010-10Mhz    Centix 2.10    cc         769     769 CT1
  159.  * EAGLE/TURBO  8086-8Mhz       Venix/86 SVR2   cc               696     779
  160.  * ALTOS 586    8086-10Mhz    Xenix 3.0b    cc          724     793
  161.  * DEC 11/73    J-11 micro    Ultrix-11 V3.0    System V     735     793
  162.  * ATT 3B2/300    WE32000-?Mhz    UNIX 5.0.2    cc         735     806
  163.  * Apollo DN320    68010-?Mhz    AegisSR9/IX    cc 3.12         806     806
  164.  * IRIS-2400    68010-10Mhz    UNIX System V    cc         772     829
  165.  * Atari 520ST  68000-8Mhz      TOS             DigResearch      839     846
  166.  * IBM PC/AT    80286-6Mhz    PCDOS 3.0    MS 3.0(large)     833     847 LM
  167.  * WICAT MB    68000-8Mhz    System V    WICAT C 4.1     675     853 S~
  168.  * VAX 11/750    -        Ultrix 1.1    4.2BSD cc     781     862
  169.  * CCC  7350A    68000-8MHz    UniSoft V.2    cc         821     875
  170.  * VAX 11/750    -        UNIX 4.2bsd    cc         862     877
  171.  * Fast Mac    68000-7.7Mhz    -        MegaMax C 2.0     839     904 +
  172.  * IBM PC/XT    8086-9.54Mhz    PCDOS 3.1    Microsoft 3.0     833     909 C1
  173.  * DEC 11/44            Ultrix-11 V3.0    System V     862     909
  174.  * Macintosh    68000-7.8Mhz 2M    Mac Rom        Mac C 16 bit int 877     909 S
  175.  * CCC 3210    ?        Xelos R01(SVR2)    cc         849     924
  176.  * CCC 3220    ?               Ed. 7 v2.3      cc         892     925
  177.  * IBM PC/AT    80286-6Mhz    Xenix 3.0    cc -i         909     925
  178.  * AT&T 6300    8086, 8mhz    MS-DOS 2.11    Aztec C v3.2d     862     943
  179.  * IBM PC/AT    80286-6Mhz    Xenix 3.0    cc         892     961
  180.  * VAX 11/750    w/FPA        Eunice 3.2    cc         914     976
  181.  * IBM PC/XT    8086-9.54Mhz    PCDOS 3.1    Wizard 2.1     892     980 C1
  182.  * IBM PC/XT    8086-9.54Mhz    PCDOS 3.1    Lattice 2.15     980     980 C1
  183.  * Plexus P35    68000-10Mhz    UNIX System III cc         984     980
  184.  * PDP-11/73    KDJ11-AA 15Mhz    UNIX V7M 2.1    cc         862     981
  185.  * VAX 11/750    w/FPA        UNIX 4.3bsd    cc         994     997
  186.  * IRIS-1400    68010-10Mhz    UNIX System V    cc         909    1000
  187.  * IBM PC/AT    80286-6Mhz    Venix/86 2.1    cc         961    1000
  188.  * IBM PC/AT    80286-6Mhz    PCDOS 3.0    b16cc 2.0     943    1063
  189.  * Zilog S8000/11 Z8001-5.5Mhz    Zeus 3.2    cc        1011    1084
  190.  * NSC ICM-3216 NSC 32016-10Mhz    UNIX SVR2    cc        1041    1084
  191.  * IBM PC/AT    80286-6Mhz    PCDOS 3.0    MS 3.0(small)    1063    1086
  192.  * VAX 11/750    w/FPA        VMS        VAX-11 C 2.0     958    1091
  193.  * Stride    68000-10Mhz    System-V/68    cc        1041    1111
  194.  * Plexus P/60  MC68000-12.5Mhz    UNIX SYSIII    Plexus        1111    1111
  195.  * ATT PC7300    68010-10Mhz    UNIX 5.2    cc        1041    1111
  196.  * CCC 3230    ?        Xelos R01(SVR2)    cc        1040    1126
  197.  * Stride    68000-12Mhz    System-V/68    cc        1063    1136
  198.  * IBM PC/AT    80286-6Mhz      Venix/286 SVR2  cc              1056    1149
  199.  * Plexus P/60  MC68000-12.5Mhz    UNIX SYSIII    Plexus        1111    1163 T
  200.  * IBM PC/AT    80286-6Mhz    PCDOS 3.0    Datalight 1.10    1190    1190
  201.  * ATT PC6300+    80286-6Mhz    MSDOS 3.1    b16cc 2.0    1111    1219
  202.  * IBM PC/AT    80286-6Mhz    PCDOS 3.1    Wizard 2.1    1136    1219
  203.  * Sun2/120    68010-10Mhz    Sun 4.2BSD    cc        1136    1219
  204.  * IBM PC/AT    80286-6Mhz    PCDOS 3.0    CI-C86 2.20M    1219    1219
  205.  * WICAT PB    68000-8Mhz    System V    WICAT C 4.1     998    1226 ~
  206.  * MASSCOMP 500    68010-10MHz    RTU V3.0    cc (V3.2)    1156    1238
  207.  * Alliant FX/8 IP (68012-12Mhz) Concentrix    cc -ip;exec -i     1170    1243 FX
  208.  * Cyb DataMate    68010-12.5Mhz    Uniplus 5.0    Unisoft cc    1162    1250
  209.  * PDP 11/70    -        UNIX 5.2    cc        1162    1250
  210.  * IBM PC/AT    80286-6Mhz    PCDOS 3.1    Lattice 2.15    1250    1250
  211.  * IBM PC/AT    80286-7.5Mhz    Venix/86 2.1    cc        1190    1315 *15
  212.  * Sun2/120    68010-10Mhz    Standalone    cc        1219    1315
  213.  * Intel 380    80286-8Mhz    Xenix R3.0up1    cc        1250    1315 *16
  214.  * Sequent Balance 8000    NS32032-10MHz    Dynix 2.0    cc    1250    1315 N12
  215.  * IBM PC/DSI-32 32032-10Mhz    MSDOS 3.1    GreenHills 2.14    1282    1315 C3
  216.  * ATT 3B2/400    WE32100-?Mhz    UNIX 5.2    cc        1315    1315
  217.  * CCC 3250XP    -        Xelos R01(SVR2)    cc        1215    1318
  218.  * IBM PC/RT 032 RISC(801?)?Mhz BSD 4.2         cc              1248    1333 RT
  219.  * DG MV4000    -        AOS/VS 5.00    cc        1333    1333
  220.  * IBM PC/AT    80286-8Mhz    Venix/86 2.1    cc        1275    1380 *16
  221.  * IBM PC/AT    80286-6Mhz    MSDOS 3.0    Microsoft 3.0    1250    1388
  222.  * ATT PC6300+    80286-6Mhz    MSDOS 3.1    CI-C86 2.20M    1428    1428
  223.  * COMPAQ/286   80286-8Mhz      Venix/286 SVR2  cc              1326    1443
  224.  * IBM PC/AT    80286-7.5Mhz    Venix/286 SVR2  cc              1333    1449 *15
  225.  * WICAT PB    68000-8Mhz    System V    WICAT C 4.1    1169    1464 S~
  226.  * Tandy II/6000 68000-8Mhz    Xenix 3.0    cc          1384    1477
  227.  * WICAT MB    68000-12.5Mhz    System V    WICAT C 4.1    1246    1537 ~
  228.  * IBM PC/AT    80286-9Mhz      SCO Xenix V     cc              1540    1556 *18
  229.  * Cyb DataMate    68010-12.5Mhz    Uniplus 5.0    Unisoft cc    1470    1562 S
  230.  * VAX 11/780    -        UNIX 5.2    cc        1515    1562
  231.  * MicroVAX-II    -        -        -        1562    1612
  232.  * Gulfstream XT 80286-8MHz    PCDOS 3.1    Turbo C 2.0    1470    1612
  233.  * VAX 11/780    -        UNIX 4.3bsd    cc        1646    1662
  234.  * Apollo DN660    -        AegisSR9/IX    cc 3.12        1666    1666
  235.  * ATT 3B20    -        UNIX 5.2    cc        1515    1724
  236.  * NEC PC-98XA    80286-8Mhz    PCDOS 3.1    Lattice 2.15    1724    1724 @
  237.  * HP9000-500    B series CPU    HP-UX 4.02    cc        1724    -
  238.  * IBM PC/STD    80286-8Mhz    MSDOS 3.0     Microsoft 3.0    1724    1785 C2
  239.  * WICAT MB    68000-12.5Mhz    System V    WICAT C 4.1    1450    1814 S~
  240.  * WICAT PB    68000-12.5Mhz    System V    WICAT C 4.1    1530    1898 ~
  241.  * DEC-2065    KL10-Model B    TOPS-20 6.1FT5    Port. C Comp.    1937    1946
  242.  * Gould PN6005    -        UTX 1.1(4.2BSD)    cc        1675    1964
  243.  * DEC2060    KL-10        TOPS-20        cc        2000    2000 &
  244.  * VAX 11/785    -        UNIX 5.2    cc        2083    2083
  245.  * VAX 11/785    -        VMS        VAX-11 C 2.0    2083    2083
  246.  * VAX 11/785    -        UNIX SVR2    cc        2123    2083
  247.  * VAX 11/785   -               ULTRIX-32 1.1   cc        2083    2091 
  248.  * VAX 11/785    -        UNIX 4.3bsd    cc        2135    2136
  249.  * WICAT PB    68000-12.5Mhz    System V    WICAT C 4.1    1780    2233 S~
  250.  * Pyramid 90x    -        OSx 2.3        cc        2272    2272
  251.  * Pyramid 90x    FPA,cache,4Mb    OSx 2.5        cc no -O    2777    2777
  252.  * Pyramid 90x    w/cache        OSx 2.5        cc w/-O        3333    3333
  253.  * IBM-4341-II    -        VM/SP3        Waterloo C 1.2  3333    3333
  254.  * IRIS-2400T    68020-16.67Mhz    UNIX System V    cc        3105    3401
  255.  * Celerity C-1200 ?        UNIX 4.2BSD    cc        3485    3468
  256.  * SUN 3/75    68020-16.67Mhz    SUN 4.2 V3    cc        3333    3571
  257.  * IBM-4341    Model 12    UTS 5.0        ?        3685    3685
  258.  * SUN-3/160    68020-16.67Mhz  Sun 4.2 V3.0A   cc        3381    3764
  259.  * Sun 3/180    68020-16.67Mhz    Sun 4.2        cc        3333    3846
  260.  * IBM-4341    Model 12    UTS 5.0        ?        3910    3910 MN
  261.  * MC 5400    68020-16.67MHz    RTU V3.0    cc (V4.0)    3952    4054
  262.  * NCR Tower32  68020-16.67Mhz  SYS 5.0 Rel 2.0 cc              3846    4545
  263.  * Gould PN9080    -        UTX-32 1.1c    cc        -    4629
  264.  * MC 5600/5700    68020-16.67MHz    RTU V3.0    cc (V4.0)    4504    4746 %
  265.  * Gould 1460-342 ECL proc      UTX/32 1.1/c    cc              5342    5677 G1
  266.  * VAX 8600    -        UNIX 4.3bsd    cc        7024    7088
  267.  * VAX 8600    -        VMS        VAX-11 C 2.0    7142    7142
  268.  * Alliant FX/8 CE        Concentrix    cc -ce;exec -c     6952    7655 FX
  269.  * CCI POWER 6/32        COS(SV+4.2)    cc        7500    7800
  270.  * CCI POWER 6/32        POWER 6 UNIX/V    cc        8236    8498
  271.  * CCI POWER 6/32        4.2 Rel. 1.2b    cc        8963    9544
  272.  * Sperry (CCI Power 6)        4.2BSD        cc        9345   10000
  273.  * CRAY-X-MP/12       105Mhz    COS 1.14    Cray C         10204   10204
  274.  * IBM-3083    -        UTS 5.0 Rel 1    cc           16666   12500
  275.  * CRAY-1A        80Mhz    CTSS        Cray C 2.0     12100   13888
  276.  * IBM-3083    -        VM/CMS HPO 3.4    Waterloo C 1.2 13889   13889
  277.  * Amdahl 470 V/8         UTS/V 5.2       cc v1.23       15560   15560
  278.  * CRAY-X-MP/48       105Mhz    CTSS        Cray C 2.0     15625   17857
  279.  * Amdahl 580    -        UTS 5.0 Rel 1.2    cc v1.5        23076   23076
  280.  * Amdahl 5860             UTS/V 5.2       cc v1.23       28970   28970
  281.  *
  282.  * NOTE
  283.  *   *   Crystal changed from 'stock' to listed value.
  284.  *   +   This Macintosh was upgraded from 128K to 512K in such a way that
  285.  *       the new 384K of memory is not slowed down by video generator accesses.
  286.  *   %   Single processor; MC == MASSCOMP
  287.  *   &   A version 7 C compiler written at New Mexico Tech.
  288.  *   @   vanilla Lattice compiler used with MicroPro standard library
  289.  *   S   Shorts used instead of ints
  290.  *   T     with Chris Torek's patches (whatever they are).
  291.  *   ~   For WICAT Systems: MB=MultiBus, PB=Proprietary Bus
  292.  *   LM  Large Memory Model. (Otherwise, all 80x8x results are small model)
  293.  *   MM  Medium Memory Model. (Otherwise, all 80x8x results are small model)
  294.  *   C1  Univation PC TURBO Co-processor; 9.54Mhz 8086, 640K RAM
  295.  *   C2  Seattle Telecom STD-286 board
  296.  *   C3  Definicon DSI-32 coprocessor
  297.  *   C?  Unknown co-processor board?
  298.  *   CT1 Convergent Technologies MegaFrame, 1 processor.
  299.  *   MN  Using Mike Newtons 'optimizer' (see net.sources).
  300.  *   G1  This Gould machine has 2 processors and was able to run 2 dhrystone
  301.  *       Benchmarks in parallel with no slowdown.
  302.  *   FH  FHC == Frank Hogg Labs (Hazelwood Uniquad 2 in an FHL box).
  303.  *   FX  The Alliant FX/8 is a system consisting of 1-8 CEs (computation
  304.  *     engines) and 1-12 IPs (interactive processors). Note N8 applies.
  305.  *   RT  This is one of the RT's that CMU has been using for awhile.  I'm
  306.  *     not sure that this is identical to the machine that IBM is selling
  307.  *     to the public.
  308.  *   Nnn This machine has multiple processors, allowing "nn" copies of the
  309.  *     benchmark to run in the same time as 1 copy.
  310.  *   ?   I don't trust results marked with '?'.  These were sent to me with
  311.  *       either incomplete info, or with times that just don't make sense.
  312.  *     ?? means I think the performance is too poor, ?! means too good.
  313.  *       If anybody can confirm these figures, please respond.
  314.  *
  315.  *  ABBREVIATIONS
  316.  *    CCC    Concurrent Computer Corp. (was Perkin-Elmer)
  317.  *    MC    Masscomp
  318.  *
  319.  *--------------------------------RESULTS END----------------------------------
  320.  *
  321.  *    The following program contains statements of a high-level programming
  322.  *    language (C) in a distribution considered representative:
  323.  *
  324.  *    assignments            53%
  325.  *    control statements        32%
  326.  *    procedure, function calls    15%
  327.  *
  328.  *    100 statements are dynamically executed.  The program is balanced with
  329.  *    respect to the three aspects:
  330.  *        - statement type
  331.  *        - operand type (for simple data types)
  332.  *        - operand access
  333.  *            operand global, local, parameter, or constant.
  334.  *
  335.  *    The combination of these three aspects is balanced only approximately.
  336.  *
  337.  *    The program does not compute anything meaningfull, but it is
  338.  *    syntactically and semantically correct.
  339.  *
  340.  */
  341.  
  342. /* Accuracy of timings and human fatigue controlled by next two lines */
  343. #define LOOPS    50000        /* Use this for slow or 16 bit machines */
  344. /*#define LOOPS    500000        /* Use this for faster machines */
  345.  
  346. /* Compiler dependent options */
  347. #undef    NOENUM            /* Define if compiler has no enum's */
  348. #undef    NOSTRUCTASSIGN        /* Define if compiler can't assign structures */
  349.  
  350. /* define only one of the next two defines */
  351. #ifdef __TURBOC__
  352. #define TIME
  353. #else
  354. #define TIMES            /* Use times(2) time function */
  355. /*#define TIME            /* Use time(2) time function */
  356. #endif
  357.  
  358. /* define the granularity of your times(2) function (when used) */
  359. #define HZ    60        /* times(2) returns 1/60 second (most) */
  360. /*#define HZ    100        /* times(2) returns 1/100 second (WECo) */
  361.  
  362. /* for compatibility with goofed up version */
  363. /*#define GOOF            /* Define if you want the goofed up version */
  364.  
  365. #ifdef GOOF
  366. char    Version[] = "1.0";
  367. #else
  368. char    Version[] = "1.1";
  369. #endif
  370.  
  371. #ifdef    NOSTRUCTASSIGN
  372. #define    structassign(d, s)    memcpy(&(d), &(s), sizeof(d))
  373. #else
  374. #define    structassign(d, s)    d = s
  375. #endif
  376.  
  377. #ifdef    NOENUM
  378. #define    Ident1    1
  379. #define    Ident2    2
  380. #define    Ident3    3
  381. #define    Ident4    4
  382. #define    Ident5    5
  383. typedef int    Enumeration;
  384. #else
  385. typedef enum    {Ident1, Ident2, Ident3, Ident4, Ident5} Enumeration;
  386. #endif
  387.  
  388. typedef int    OneToThirty;
  389. typedef int    OneToFifty;
  390. typedef char    CapitalLetter;
  391. typedef char    String30[31];
  392. typedef int    Array1Dim[51];
  393. typedef int    Array2Dim[51][51];
  394.  
  395. struct    Record
  396. {
  397.     struct Record        *PtrComp;
  398.     Enumeration        Discr;
  399.     Enumeration        EnumComp;
  400.     OneToFifty        IntComp;
  401.     String30        StringComp;
  402. };
  403.  
  404. typedef struct Record     RecordType;
  405. typedef RecordType *    RecordPtr;
  406. typedef int        boolean;
  407.  
  408. #define    NULL        0
  409. #define    TRUE        1
  410. #define    FALSE        0
  411.  
  412. #ifndef REG
  413. #define    REG
  414. #endif
  415.  
  416. extern Enumeration    Func1();
  417. extern boolean        Func2();
  418.  
  419. #ifdef TIMES
  420. #include <sys/types.h>
  421. #include <sys/times.h>
  422. #endif
  423.  
  424. main()
  425. {
  426.     Proc0();
  427.     exit(0);
  428. }
  429.  
  430. /*
  431.  * Package 1
  432.  */
  433. int        IntGlob;
  434. boolean        BoolGlob;
  435. char        Char1Glob;
  436. char        Char2Glob;
  437. Array1Dim    Array1Glob;
  438. Array2Dim    Array2Glob;
  439. RecordPtr    PtrGlb;
  440. RecordPtr    PtrGlbNext;
  441.  
  442. Proc0()
  443. {
  444.     OneToFifty        IntLoc1;
  445.     REG OneToFifty        IntLoc2;
  446.     OneToFifty        IntLoc3;
  447.     REG char        CharLoc;
  448.     REG char        CharIndex;
  449.     Enumeration         EnumLoc;
  450.     String30        String1Loc;
  451.     String30        String2Loc;
  452.     extern char        *malloc();
  453.  
  454. #ifdef TIME
  455.     long            time();
  456.     long            starttime;
  457.     long            benchtime;
  458.     long            nulltime;
  459.     register unsigned int    i;
  460.  
  461.     starttime = time( (long *) 0);
  462.     for (i = 0; i < LOOPS; ++i);
  463.     nulltime = time( (long *) 0) - starttime; /* Computes o'head of loop */
  464. #endif
  465. #ifdef TIMES
  466.     time_t            starttime;
  467.     time_t            benchtime;
  468.     time_t            nulltime;
  469.     struct tms        tms;
  470.     register unsigned int    i;
  471.  
  472.     times(&tms); starttime = tms.tms_utime;
  473.     for (i = 0; i < LOOPS; ++i);
  474.     times(&tms);
  475.     nulltime = tms.tms_utime - starttime; /* Computes overhead of looping */
  476. #endif
  477.  
  478.     PtrGlbNext = (RecordPtr) malloc(sizeof(RecordType));
  479.     PtrGlb = (RecordPtr) malloc(sizeof(RecordType));
  480.     PtrGlb->PtrComp = PtrGlbNext;
  481.     PtrGlb->Discr = Ident1;
  482.     PtrGlb->EnumComp = Ident3;
  483.     PtrGlb->IntComp = 40;
  484.     strcpy(PtrGlb->StringComp, "DHRYSTONE PROGRAM, SOME STRING");
  485. #ifndef    GOOF
  486.     strcpy(String1Loc, "DHRYSTONE PROGRAM, 1'ST STRING");    /*GOOF*/
  487. #endif
  488.     Array2Glob[8][7] = 10;    /* Was missing in published program */
  489.  
  490. /*****************
  491. -- Start Timer --
  492. *****************/
  493. #ifdef TIME
  494.     starttime = time( (long *) 0);
  495. #endif
  496. #ifdef TIMES
  497.     times(&tms); starttime = tms.tms_utime;
  498. #endif
  499.     for (i = 0; i < LOOPS; ++i)
  500.     {
  501.  
  502.         Proc5();
  503.         Proc4();
  504.         IntLoc1 = 2;
  505.         IntLoc2 = 3;
  506.         strcpy(String2Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
  507.         EnumLoc = Ident2;
  508.         BoolGlob = ! Func2(String1Loc, String2Loc);
  509.         while (IntLoc1 < IntLoc2)
  510.         {
  511.             IntLoc3 = 5 * IntLoc1 - IntLoc2;
  512.             Proc7(IntLoc1, IntLoc2, &IntLoc3);
  513.             ++IntLoc1;
  514.         }
  515.         Proc8(Array1Glob, Array2Glob, IntLoc1, IntLoc3);
  516.         Proc1(PtrGlb);
  517.         for (CharIndex = 'A'; CharIndex <= Char2Glob; ++CharIndex)
  518.             if (EnumLoc == Func1(CharIndex, 'C'))
  519.                 Proc6(Ident1, &EnumLoc);
  520.         IntLoc3 = IntLoc2 * IntLoc1;
  521.         IntLoc2 = IntLoc3 / IntLoc1;
  522.         IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1;
  523.         Proc2(&IntLoc1);
  524.     }
  525.  
  526. /*****************
  527. -- Stop Timer --
  528. *****************/
  529.  
  530. #ifdef TIME
  531.     benchtime = time( (long *) 0) - starttime - nulltime;
  532.     printf("Dhrystone(%s) time for %ld passes = %ld\n",
  533.         Version,
  534.         (long) LOOPS, benchtime);
  535.     printf("This machine benchmarks at %ld dhrystones/second\n",
  536.         ((long) LOOPS) / benchtime);
  537. #endif
  538. #ifdef TIMES
  539.     times(&tms);
  540.     benchtime = tms.tms_utime - starttime - nulltime;
  541.     printf("Dhrystone(%s) time for %ld passes = %ld\n",
  542.         Version,
  543.         (long) LOOPS, benchtime/HZ);
  544.     printf("This machine benchmarks at %ld dhrystones/second\n",
  545.         ((long) LOOPS) * HZ / benchtime);
  546. #endif
  547.  
  548. }
  549.  
  550. Proc1(PtrParIn)
  551. REG RecordPtr    PtrParIn;
  552. {
  553. #define    NextRecord    (*(PtrParIn->PtrComp))
  554.  
  555.     structassign(NextRecord, *PtrGlb);
  556.     PtrParIn->IntComp = 5;
  557.     NextRecord.IntComp = PtrParIn->IntComp;
  558.     NextRecord.PtrComp = PtrParIn->PtrComp;
  559.     Proc3(NextRecord.PtrComp);
  560.     if (NextRecord.Discr == Ident1)
  561.     {
  562.         NextRecord.IntComp = 6;
  563.         Proc6(PtrParIn->EnumComp, &NextRecord.EnumComp);
  564.         NextRecord.PtrComp = PtrGlb->PtrComp;
  565.         Proc7(NextRecord.IntComp, 10, &NextRecord.IntComp);
  566.     }
  567.     else
  568.         structassign(*PtrParIn, NextRecord);
  569.  
  570. #undef    NextRecord
  571. }
  572.  
  573. Proc2(IntParIO)
  574. OneToFifty    *IntParIO;
  575. {
  576.     REG OneToFifty        IntLoc;
  577.     REG Enumeration        EnumLoc;
  578.  
  579.     IntLoc = *IntParIO + 10;
  580.     for(;;)
  581.     {
  582.         if (Char1Glob == 'A')
  583.         {
  584.             --IntLoc;
  585.             *IntParIO = IntLoc - IntGlob;
  586.             EnumLoc = Ident1;
  587.         }
  588.         if (EnumLoc == Ident1)
  589.             break;
  590.     }
  591. }
  592.  
  593. Proc3(PtrParOut)
  594. RecordPtr    *PtrParOut;
  595. {
  596.     if (PtrGlb != NULL)
  597.         *PtrParOut = PtrGlb->PtrComp;
  598.     else
  599.         IntGlob = 100;
  600.     Proc7(10, IntGlob, &PtrGlb->IntComp);
  601. }
  602.  
  603. Proc4()
  604. {
  605.     REG boolean    BoolLoc;
  606.  
  607.     BoolLoc = Char1Glob == 'A';
  608.     BoolLoc |= BoolGlob;
  609.     Char2Glob = 'B';
  610. }
  611.  
  612. Proc5()
  613. {
  614.     Char1Glob = 'A';
  615.     BoolGlob = FALSE;
  616. }
  617.  
  618. extern boolean Func3();
  619.  
  620. Proc6(EnumParIn, EnumParOut)
  621. REG Enumeration    EnumParIn;
  622. REG Enumeration    *EnumParOut;
  623. {
  624.     *EnumParOut = EnumParIn;
  625.     if (! Func3(EnumParIn) )
  626.         *EnumParOut = Ident4;
  627.     switch (EnumParIn)
  628.     {
  629.     case Ident1:    *EnumParOut = Ident1; break;
  630.     case Ident2:    if (IntGlob > 100) *EnumParOut = Ident1;
  631.             else *EnumParOut = Ident4;
  632.             break;
  633.     case Ident3:    *EnumParOut = Ident2; break;
  634.     case Ident4:    break;
  635.     case Ident5:    *EnumParOut = Ident3;
  636.     }
  637. }
  638.  
  639. Proc7(IntParI1, IntParI2, IntParOut)
  640. OneToFifty    IntParI1;
  641. OneToFifty    IntParI2;
  642. OneToFifty    *IntParOut;
  643. {
  644.     REG OneToFifty    IntLoc;
  645.  
  646.     IntLoc = IntParI1 + 2;
  647.     *IntParOut = IntParI2 + IntLoc;
  648. }
  649.  
  650. Proc8(Array1Par, Array2Par, IntParI1, IntParI2)
  651. Array1Dim    Array1Par;
  652. Array2Dim    Array2Par;
  653. OneToFifty    IntParI1;
  654. OneToFifty    IntParI2;
  655. {
  656.     REG OneToFifty    IntLoc;
  657.     REG OneToFifty    IntIndex;
  658.  
  659.     IntLoc = IntParI1 + 5;
  660.     Array1Par[IntLoc] = IntParI2;
  661.     Array1Par[IntLoc+1] = Array1Par[IntLoc];
  662.     Array1Par[IntLoc+30] = IntLoc;
  663.     for (IntIndex = IntLoc; IntIndex <= (IntLoc+1); ++IntIndex)
  664.         Array2Par[IntLoc][IntIndex] = IntLoc;
  665.     ++Array2Par[IntLoc][IntLoc-1];
  666.     Array2Par[IntLoc+20][IntLoc] = Array1Par[IntLoc];
  667.     IntGlob = 5;
  668. }
  669.  
  670. Enumeration Func1(CharPar1, CharPar2)
  671. CapitalLetter    CharPar1;
  672. CapitalLetter    CharPar2;
  673. {
  674.     REG CapitalLetter    CharLoc1;
  675.     REG CapitalLetter    CharLoc2;
  676.  
  677.     CharLoc1 = CharPar1;
  678.     CharLoc2 = CharLoc1;
  679.     if (CharLoc2 != CharPar2)
  680.         return (Ident1);
  681.     else
  682.         return (Ident2);
  683. }
  684.  
  685. boolean Func2(StrParI1, StrParI2)
  686. String30    StrParI1;
  687. String30    StrParI2;
  688. {
  689.     REG OneToThirty        IntLoc;
  690.     REG CapitalLetter    CharLoc;
  691.  
  692.     IntLoc = 1;
  693.     while (IntLoc <= 1)
  694.         if (Func1(StrParI1[IntLoc], StrParI2[IntLoc+1]) == Ident1)
  695.         {
  696.             CharLoc = 'A';
  697.             ++IntLoc;
  698.         }
  699.     if (CharLoc >= 'W' && CharLoc <= 'Z')
  700.         IntLoc = 7;
  701.     if (CharLoc == 'X')
  702.         return(TRUE);
  703.     else
  704.     {
  705.         if (strcmp(StrParI1, StrParI2) > 0)
  706.         {
  707.             IntLoc += 7;
  708.             return (TRUE);
  709.         }
  710.         else
  711.             return (FALSE);
  712.     }
  713. }
  714.  
  715. boolean Func3(EnumParIn)
  716. REG Enumeration    EnumParIn;
  717. {
  718.     REG Enumeration    EnumLoc;
  719.  
  720.     EnumLoc = EnumParIn;
  721.     if (EnumLoc == Ident3) return (TRUE);
  722.     return (FALSE);
  723. }
  724.  
  725. #ifdef    NOSTRUCTASSIGN
  726. memcpy(d, s, l)
  727. register char    *d;
  728. register char    *s;
  729. register int    l;
  730. {
  731.     while (l--) *d++ = *s++;
  732. }
  733. #endif
  734.